function main() {
    // ol.album-list: 找到 class 属性是 album-list 的 ol 标签
    var olElement = document.querySelector("body")
    var cid = getParameter("cid")
    header()

    function onResult(result) {
        var List = result.data
        // 遍历专辑列表
        for (var list of List) {
            // 针对每个专辑创建 html
            // var html = "<li>" + album.name + "</li>";
            // JS 中的模板字符串，使用反引号(键盘上波浪线的按键) `
            //var html = `<li>${album.name}</li>`
            var html = `<table width="1004" border="0" align="center" cellpadding="1" cellspacing="10" bordercolor="#FFFFFF" bgcolor="#FFFFFF">
    <tr>
        <td align="center" valign="top" bgcolor="#FFFFFF" class="bg_qc">
            <table width="100%" height="27" border="0" cellpadding="8" cellspacing="0" bgcolor="#F6F6F6">
            </table>
            <table height="35" border="0" cellpadding="0" cellspacing="0">
                <tr>
                    <td></td>
                </tr>
            </table>
            <table height="25" border="0" cellpadding="0" cellspacing="0">
                <tr>
                    <td align="center" class="p28"><font class="p28">${list.gtitle }</font></td>
                </tr>
            </table>
            <table height="25" border="0" cellpadding="0" cellspacing="0">
                <tr>
                    <td align="center" class="p28"><font class="p28">薪资待遇：${list.gsalary }</font></td>
                </tr>
            </table>
             <table height="25" border="0" cellpadding="0" cellspacing="0">
                <tr>
                    <td align="center" class="p28"><font class="p28">工作地点：${list.address }</font></td>
                </tr>
            </table>
            <table height="35" border="0" cellpadding="0" cellspacing="0">
                <tr>
                    <td></td>
                </tr>
            </table>
            <table width="98%" border="0" cellpadding="0" cellspacing="0" bgcolor="#F6F6F6" class="dx">
                <tr>
                    <td height="20" align="center">
                        &nbsp;&nbsp;发布人：${list.rname } &nbsp;&nbsp;‖
                        &nbsp;&nbsp;联系方式：${list.rphone } &nbsp;&nbsp;‖
                        &nbsp;&nbsp;邮箱：${list.remail }&nbsp;&nbsp;‖
                    </td>
                </tr>
            </table>

            <table height="15" border="0" cellpadding="0" cellspacing="0">
                <tr>
                    <td></td>
                </tr>
            </table>

            <table height="15" border="0" cellpadding="0" cellspacing="0">
                <tr>
                    <td></td>
                </tr>
            </table>
            <table width="95%" border="0" cellpadding="0" cellspacing="0">
                <tr>
                    <td align="left">
                        <div class="z" id="z">${list.gcontents }</div>
                    </td>
                </tr>
            </table>
            <table width="95%" height="60" border="0" cellpadding="0" cellspacing="0" class="dx">
                <tr>
                    <td align="center" valign="middle"><input name="button" type=button
                                                              onClick="window.location='javascript:window.print()'" value="打印此页"> &nbsp;&nbsp;&nbsp;&nbsp; <input
                            name="button2" type=button onClick="window.location='#'" value="返回顶部"> 
                </tr>
            </table>

        </td>
    </tr>
</table>
`

            olElement.innerHTML = html
        }
    }

    // 先从 url 中的 query string 部分，获取 keyword 参数

    var url = "/api/company-job-list.json?cid="+cid;

    ajax("get", url, onResult)
}

// window 的 load 事件发生时，执行 main 方法
// 浏览器把所有的资源都加载到位时，window 的 load 事件就会发生
// 白话：当浏览器把所有的资源都加载到位时，再去执行我们的 main 函数
window.addEventListener("load", main)